Skip to contentSkip to conversation

genericx86: wic wks do not hardcode loader

PATCH In review Lee Chee Yang 1 participant 4 messages Dec 3, 2019 – Dec 9, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 genericx86: wic wks do not hardcode loader

From: Chee Yang Lee <[email protected]>

replace .wks with .wks.in and refer loader to EFI_PROVIDER to enable different bootloader.
soft assign default EFI_PROVIDER "grub-efi" for genericx86.

---
 meta-yocto-bsp/conf/machine/include/genericx86-common.inc | 3 ++-
 meta-yocto-bsp/wic/genericx86.wks                         | 7 -------
 meta-yocto-bsp/wic/genericx86.wks.in                      | 7 +++++++
 3 files changed, 9 insertions(+), 8 deletions(-)
 delete mode 100644 meta-yocto-bsp/wic/genericx86.wks
 create mode 100644 meta-yocto-bsp/wic/genericx86.wks.in
meta-yocto-bsp/conf/machine/include/genericx86-common.inc +2 -1
index f83ce5c..a6c396c 100644
@@ -20,6 +20,7 @@ GLIBC_ADDONS = "nptl"
 EXTRA_OECONF_append_pn-matchbox-panel-2 = " --with-battery=acpi"
 
 IMAGE_FSTYPES += "wic wic.bmap"
-WKS_FILE ?= "genericx86.wks"
+WKS_FILE ?= "genericx86.wks.in"
+EFI_PROVIDER ??= "grub-efi"
 do_image_wic[depends] += "gptfdisk-native:do_populate_sysroot"
 do_image_wic[recrdeptask] += "do_bootimg"
meta-yocto-bsp/wic/genericx86.wks deleted +0 -7
deleted file mode 100644
index dab719c..0000000
@@ -1,7 +0,0 @@
-# short-description: Create an EFI disk image for genericx86*
-# long-description: Creates a partitioned EFI disk image for genericx86* machines
-part /boot --source bootimg-efi --sourceparams="loader=grub-efi" --ondisk sda --label msdos --active --align 1024
-part / --source rootfs --ondisk sda --fstype=ext4 --label platform --align 1024 --use-uuid
-part swap --ondisk sda --size 44 --label swap1 --fstype=swap
-
-bootloader --ptable gpt --timeout=5 --append="rootfstype=ext4 console=ttyS0,115200 console=tty0"
meta-yocto-bsp/wic/genericx86.wks.in new file +7 -0
new file mode 100644
index 0000000..7c09ad0
@@ -0,0 +1,7 @@
+# short-description: Create an EFI disk image for genericx86*
+# long-description: Creates a partitioned EFI disk image for genericx86* machines
+part /boot --source bootimg-efi --sourceparams="loader=${EFI_PROVIDER}" --ondisk sda --label msdos --active --align 1024
+part / --source rootfs --ondisk sda --fstype=ext4 --label platform --align 1024 --use-uuid
+part swap --ondisk sda --size 44 --label swap1 --fstype=swap
+
+bootloader --ptable gpt --timeout=5 --append="rootfstype=ext4 console=ttyS0,115200 console=tty0"
Signature · 1 line
2.7.4
#1 lore raw

PATCH 2/2 selftest/systemd-boot: test against wic image

From: Chee Yang Lee <[email protected]>

effort to remove live for x86 from default image see https://bugzilla.yoctoproject.org/show_bug.cgi?id=11291

reduce dependency on hddimg, change the test to based on wic image.

---
 meta-yocto-bsp/lib/oeqa/selftest/cases/systemd_boot.py | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
meta-yocto-bsp/lib/oeqa/selftest/cases/systemd_boot.py +4 -5
index 0a3a2cd..b3db226d 100644
@@ -38,9 +38,9 @@ class Systemdboot(OESelftestTestCase):
         """
         Summary:      Check if EFI bootloader for systemd is correctly build
         Dependencies: Image was built correctly on testcase 1445
-        Steps:        1. Copy bootx64.efi file form the hddimg created
+        Steps:        1. Copy bootx64.efi file from the wic created
                       under build/tmp/deploy/images/genericx86-64
-                      2. Check bootx64.efi was copied form hddimg
+                      2. Check bootx64.efi was copied from wic
                       3. Verify the checksums from the copied and previously
                       created file are equal.
         Expected :    Systemd-bootx64.efi and bootx64.efi should be the same
@@ -50,15 +50,14 @@ class Systemdboot(OESelftestTestCase):
         AutomatedBy:  Jose Perez Carranza <jose.perez.carranza at linux-intel.com>
         """
 
-        systemdbootimage = os.path.join(deploydir, 'core-image-minimal-genericx86-64.hddimg')
+        systemdbootimage = os.path.join(deploydir, 'core-image-minimal-genericx86-64.wic')
         imagebootfile = os.path.join(deploydir, 'bootx64.efi')
-        mcopynative = os.path.join(get_bb_var('STAGING_BINDIR_NATIVE', "core-image-minimal"), 'mcopy')
 
         # Clean environment before start the test
         if os.path.isfile(imagebootfile):
             runCmd('rm -f %s' % imagebootfile)
 
-        runCmd('%s -i %s ::EFI/BOOT/bootx64.efi %s' % (mcopynative ,systemdbootimage,
+        runCmd('wic cp %s:1/EFI/BOOT/bootx64.efi %s' % (systemdbootimage,
                                                            imagebootfile))
 
         found = os.path.isfile(imagebootfile)
Signature · 1 line
2.7.4
#2 lore raw

Re: [meta-yocto-bsp][PATCH 2/2] selftest/systemd-boot: test against wic image

could take below patch once this patch series is merged.
[OE-core] [PATCH] conf/machine/x86-base: use wic instead of live ( http:// http//lists.openembedded.org/pipermail/openembedded-core/2019-November/289819.html )

#3 lore raw

Re: [meta-yocto-bsp][PATCH 2/2] selftest/systemd-boot: test against wic image

ping